//
//  UMDFileReader.h
//  UMDReader
//
//  Created by 张 霄鹤 on 10-1-6.
//  Copyright 2010 xhzhang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UMDBook.h"
#import "LEDataInputStream.h"

@interface UMDFileReader : NSObject {
	UMDBook *book;
	NSString *publishYear;
	NSString *publishMonth;
	NSString *publishDay;
	NSMutableArray *chaptersOffset;
	NSInteger totalContentLength;
	NSMutableArray *zippedContentList;
	NSMutableArray *totalImageList;
	NSInteger additionalCheckNumber;
}

- (id)init;

- (UMDBook *)read:(NSString *)filePath;

- (UMDBook *)readWithInputStream:(LEDataInputStream *)reader;

- (void)readSection:(short)segType withFlag:(char)flag andLength:(char)length useStream:(LEDataInputStream *)reader forBook:(UMDBook *)bk;

- (void)readAdditionalSection:(short)segType withCheckNum:(NSInteger)checkNumber andLength:(NSInteger)length useStream:(LEDataInputStream *)reader forBook:(UMDBook *)bk;

- (void)parseChapterImages:(UMDBook *)bk;

- (void)parseChapterTextContents:(UMDBook *)bk;

- (Chapter *)getChapter:(NSInteger)index;

@end
